package confirm;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class ConnectUtils {

    public static Connection getRabbitConn() throws Exception {
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("xxxxx");
        connectionFactory.setPort(5672);
        connectionFactory.setUsername("xiangjiao2");
        connectionFactory.setPassword("bunana2");
        connectionFactory.setVirtualHost("/xiangjiao_topic");

        return connectionFactory.newConnection();
    }
}
